//JavaScript Framework 2.0 Code
try {
	Type.registerNamespace('com.yonyou.ncmm_pac_pda.DM_barcoderule_docDetailController');
	com.yonyou.ncmm_pac_pda.DM_barcoderule_docDetailController = function() {
		com.yonyou.ncmm_pac_pda.DM_barcoderule_docDetailController.initializeBase(this);
		this.initialize();
	}

	function com$yonyou$ncmm_pac_pda$DM_barcoderule_docDetailController$initialize() {

	}

	function com$yonyou$ncmm_pac_pda$DM_barcoderule_docDetailController$evaljs(js) {
		eval(js)
	}

	function com$yonyou$ncmm_pac_pda$DM_barcoderule_docDetailController$back(sender, args) {
		$view.close({
			"resultCode": "15"
		});
	}

	function com$yonyou$ncmm_pac_pda$DM_barcoderule_docDetailController$listviewdefine0_onload(sender, args) {
		$js.showLoadingBar({
			msg: "正在加载数据……"
		});
		var param = $param.getJSONObject("row");
		param = $stringToJSON(param);
		//		$alert($jsonToString({"param":param}));

		if(param["downloadnum"] == null || param["downloadnum"] == "" || param["downloadnum"] == "0") {
			var jsondata = {
				param: param,
				doctitle: param["appbillname"],
			};
			$ctx.push(jsondata);
		} else {
			NCMMPubUtil.queryVO(BarCodeRuleVO, null, function(data) {
				data = eval(data);
				data = NCMMPubUtil.htmlspecialjsonarray2UI(data);
				if($isJSONArray(data)) {
					for(var i = 0; i < data.length; i++) {
						var pk_barcoderule = data[i]["pk_barcoderule"];
						//						$alert("pk_barcoderule=" + pk_barcoderule);
						var wheresql = "where pk_barcoderule = '" + pk_barcoderule + "'";
						NCMMPubUtil.queryVO(BarCodeRuleBodyVO, wheresql, function(subdata) {
							subdata = eval(subdata);
							subdata = NCMMPubUtil.htmlspecialjsonarray2UI(subdata);
							//							$alert("subdata.length=" + subdata.length);
							data[i]["row"] = subdata;
						});
					}
				}
				var jsondata = {
					param: param,
					source: data
				};

				$ctx.push(jsondata);
			});
		}
		$js.hideLoadingBar();
	}
	com.yonyou.ncmm_pac_pda.DM_barcoderule_docDetailController.prototype = {
		listviewdefine0_onload: com$yonyou$ncmm_pac_pda$DM_barcoderule_docDetailController$listviewdefine0_onload,
		back: com$yonyou$ncmm_pac_pda$DM_barcoderule_docDetailController$back,
		initialize: com$yonyou$ncmm_pac_pda$DM_barcoderule_docDetailController$initialize,
		evaljs: com$yonyou$ncmm_pac_pda$DM_barcoderule_docDetailController$evaljs
	};
	com.yonyou.ncmm_pac_pda.DM_barcoderule_docDetailController.registerClass('com.yonyou.ncmm_pac_pda.DM_barcoderule_docDetailController', UMP.UI.Mvc.Controller);
} catch(e) {
	$e(e);
}